package com.minarto.slot {
	import scaleform.clik.interfaces.IListItemRenderer;
	import scaleform.clik.controls.TileList;

	/**
	 * @author KIMMINHWAN
	 */
	public class SlotTileList extends TileList {
		protected var _isDrag:Boolean = false,
						_isUse:Boolean = false;
						
						
		public var srcField:String = "src",
					countField:String = "count";
		
		
		
		public function get isDrag() : Boolean {
			return _isDrag;
		}
		public function set isDrag($v : Boolean) : void {
			if(_isDrag == $v)	return;
			_isDrag = $v;
			invalidateData();
		}
		
		
		public function get isUse() : Boolean {
			return _isUse;
		}
		public function set isUse($v : Boolean) : void {
			if(_isUse == $v)	return;
			_isUse = $v;
			invalidateData();
		}
		
		override public function toString() : String {
			return "minarto SlotTileList" + name;
		}
		
		
		override protected function setupRenderer($renderer:IListItemRenderer):void {
			super.setupRenderer($renderer);
			
			var r:ISlot = ISlot($renderer);
			if(r){
				r.isDrag = _isDrag;
				r.isUse = _isUse;
				r.srcField = srcField;
				r.countField = countField;
			}
        }
	}
}
